<? 
	$title="User List"; 
	$pageid="4";
	$accessid=",a10,";

	if(isset($_POST['btnsubmit']))
	{
		require("required/dbconnect.php");
		$contact_number=$_POST['contact_number'];
		$email=$_POST['email'];
		$email_hidden=$_POST['email_hidden'];
		$address1=$_POST['address1'];
		$address2=$_POST['address2'];
		$fax=$_POST['fax'];
		$website=$_POST['website'];
		$logo_url=$_POST['logo_url'];
		$website_name=$_POST['website_name'];
		$cc_gatewayurl=$_POST['cc_gatewayurl'];
		$cc_verifykey=$_POST['cc_verifykey'];
		$cc_username=$_POST['cc_username'];
		$cc_returnurl=$_POST['cc_returnurl'];
		$paypal_emailaddress=$_POST['paypal_emailaddress'];
		$paypal_submit_url=$_POST['paypal_submit_url'];
		$cc_allowed=$_POST['cc_allowed'];
		$paypal_allowed=$_POST['paypal_allowed'];
		
		$email_host=$_POST['email_host'];
		$email_username=$_POST['email_username'];
		$email_password=$_POST['email_password'];
		$email_fromname=$_POST['email_fromname'];
		$email_reply=$_POST['email_reply'];
		
		
		$update=mysql_query("update os_contactinfo set contact_number='$contact_number',email='$email',email_hidden='$email_hidden',
							email_host='$email_host',email_username='$email_username',email_password='$email_password',email_fromname='$email_fromname',email_reply='$email_reply',
							address1='$address1',address2='$address2',fax='$fax',website='$website',website_name='$website_name',logo_url='$logo_url',cc_gatewayurl='$cc_gatewayurl',cc_verifykey='$cc_verifykey',cc_username='$cc_username',cc_returnurl='$cc_returnurl',paypal_emailaddress='$paypal_emailaddress',paypal_submit_url='$paypal_submit_url',cc_allowed='$cc_allowed',paypal_allowed='$paypal_allowed' where id=1")or die(mysql_error());
		//echo "update os_contactinfo set contact_number='$contact_number',email='$email',email_hidden='$email_hidden',address1='$address1',address2='$address2',fax='$fax',website='$website',website_name='$website_name',logo_url='$logo_url',cc_gatewayurl='$cc_gatewayurl',cc_verifykey='$cc_verifykey',cc_username='$cc_username',cc_returnurl='$cc_returnurl',paypal_emailaddress='$paypal_emailaddress',paypal_submit_url='$paypal_submit_url',cc_allowed='$cc_allowed',paypal_allowed='$paypal_allowed' where id=1";
		
		header("Location:systemsetting.php?msg=1");
	}
	
	require("required/dbconnect.php"); 
	require("required/function.php");	
	require("required/header.php");


	if(empty($_GET['msg']))
	{
		$msg="";
	}
	else
	{
		$msg="<div class='dw_success'>Data updated!</div>";
	}
	
	
	$get_info=mysql_query("select * from os_contactinfo where id=1");
	
	$a=mysql_fetch_array($get_info,MYSQL_ASSOC);
	
	
?>
<table width="100%"  cellpadding="0" cellspacing="5" height="300">
<tr>
	
	<td valign="top">
			<?= $msg ?>
			<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post">
			<table width="100%" class="solidborder">
				
				<tr>
					<td colspan="3">
					<strong>Layout Setting</strong>
					<br>
					<hr style="height:1px;color:#000000"></td>
				</tr>
				<tr>
					<td>Website URL</td><td><input type="text" value="<?= $a['website'] ?>" name="website" maxlength="100" size="70"></td>
				</tr>
				<tr>
					<td>Website's Name</td><td><input type="text" value="<?= $a['website_name'] ?>" name="website_name" maxlength="100" size="30"></td>
				</tr>
				<tr>
					<td>Email's Logo URL</td><td><input type="text" value="<?= $a['logo_url'] ?>" name="logo_url" maxlength="100" size="70"></td>
				</tr>
				<tr valign="top">
					<td>Product Watermark</td><td>
					<table><td bgcolor="#333333">
					<img src="../images/watermark/watermark.png">
					</td></table>
					<br>
					<a href="wm_upload.php">Upload</a>
					</td>
				</tr>
				<tr>
					<td colspan="3"><br><br>
					<strong>Payment Setting</strong>
					<br>
					<hr style="height:1px;color:#000000"></td>
				</tr>
				<tr>
					<td>Pay By E Banking</td>
					<td><select disabled>
							<option value="1">Allowed</option>
							<option value="0">Not Allowed</option>
						</select>
					</td>
				</tr>
				<?
					if($a['cc_allowed']==0)
					{
						$cc_slt1="";
						$cc_slt2="selected";
					}else{
						$cc_slt1="selected";
						$cc_slt2="";
					}	
				?>
				<tr>
					<td>Pay By Credit Card</td>
					<td><select name="cc_allowed">
							<option value="1" <?= $cc_slt1 ?>>Allowed</option>
							<option value="0" <?= $cc_slt2 ?>>Not Allowed</option>
						</select>
					</td>
				</tr>
				<?
					if($a['paypal_allowed']==0)
					{
						$pp_slt1="";
						$pp_slt2="selected";
					}else{
						$pp_slt1="selected";
						$pp_slt2="";
					}	
				?>
				<tr>
					<td>Pay By Paypal</td>
					<td><select name="paypal_allowed">
							<option value="1" <?= $pp_slt1 ?>>Allowed</option>
							<option value="0" <?= $pp_slt2 ?>>Not Allowed</option>
						</select>
					</td>
				</tr>
				<tr>
					<td colspan="3">
					<br><br>
					<strong><img src="../images/cc.png" align="absmiddle"> Setting</strong>
					<br>
					<hr style="height:1px;color:#000000">
					</td>
				</tr>
				<tr>
					<td>Credit card gateway url</td><td><input type="text" value="<?= $a['cc_gatewayurl'] ?>" name="cc_gatewayurl" maxlength="100" size="70"></td>
				</tr>
				<tr>
					<td>Merchant ID/User name</td><td><input type="text" value="<?= $a['cc_username'] ?>" name="cc_username" maxlength="100" size="30"></td>
				</tr>
				<tr>
					<td>Verify key</td><td><input type="text" value="<?= $a['cc_verifykey'] ?>" name="cc_verifykey" maxlength="100" size="50"></td>
				</tr>
				<tr>
					<td>Return page url</td><td><input type="text" value="<?= $a['cc_returnurl'] ?>" name="cc_returnurl" maxlength="100" size="70"></td>
				</tr>
				
				
				<tr>
					<td colspan="3">
					<br><br>
					<strong><img src="../images/p1.gif" align="absmiddle"> Setting</strong>
					<br>
					<hr style="height:1px;color:#000000">
					</td>
				</tr>
				<tr>
					<td>Paypal Email Address</td><td><input type="text" value="<?= $a['paypal_emailaddress'] ?>" name="paypal_emailaddress" maxlength="100" size="50"></td>
				</tr>
				<tr valign="top">
					<td>Paypal Submit URL</td><td><input type="text" value="<?= $a['paypal_submit_url'] ?>" name="paypal_submit_url" maxlength="100" size="70">
					<br>
					Paypal sandbox : https://www.sandbox.paypal.com/cgi-bin/webscr<br>
					Paypal live : https://www.paypal.com/cgi-bin/webscr
					</td>
				</tr>
				<td width="34%">
					
					<input type="submit" value="Save" class="button" name="btnsubmit">
				</td>
			</table>
			</form>
		</td>
	</tr>
	
	
</table>
<? require("required/footer.php"); ?>

